package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.UserPositionForm;
import com.springboot.cloud.demos.entity.po.User;
import com.springboot.cloud.demos.entity.po.UserPosition;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author qjmove
 */
@FeignClient(name = "ribbon-consumer", fallback = UserPositionServiceFallback.class)
public interface UserPositionService {

    @RequestMapping(value = "/userPosition/query", method = RequestMethod.GET)
    Result<UserPosition> query(@RequestParam("userId") String userId);

    @GetMapping("/userPosition/{id}")
    Result<UserPosition> get(@PathVariable(value = "id") String id) ;

    @RequestMapping(value = "/userPosition", method = RequestMethod.POST)
    Result<User> add(@RequestBody UserPositionForm userPosition);

    @RequestMapping(value = "/userPosition", method = RequestMethod.PUT)
    Result update(@RequestBody UserPositionForm userPosition);

}
